<?php

/**
 * Alumno filter form base class.
 *
 * @package    BecArTe
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseAlumnoFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'apellido'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'nombre'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'domicilio'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'telefono'             => new sfWidgetFormFilterInput(),
      'celular'              => new sfWidgetFormFilterInput(),
      'email'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'tipo_doc_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('tipo_doc'), 'add_empty' => true)),
      'documento'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'cuil'                 => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'fecha_nacimiento'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'ciudad_actual_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ciudad_actual'), 'add_empty' => true)),
      'ciudad_nacimiento_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ciudad_nacimiento'), 'add_empty' => true)),
      'nacionalidad_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('nacionalidad'), 'add_empty' => true)),
      'sede_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('sede'), 'add_empty' => true)),
      'sf_guard_user_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('usuario'), 'add_empty' => true)),
      'created_at'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'created_by'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Creator'), 'add_empty' => true)),
      'updated_by'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Updator'), 'add_empty' => true)),
      'version'              => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'apellido'             => new sfValidatorPass(array('required' => false)),
      'nombre'               => new sfValidatorPass(array('required' => false)),
      'domicilio'            => new sfValidatorPass(array('required' => false)),
      'telefono'             => new sfValidatorPass(array('required' => false)),
      'celular'              => new sfValidatorPass(array('required' => false)),
      'email'                => new sfValidatorPass(array('required' => false)),
      'tipo_doc_id'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('tipo_doc'), 'column' => 'id')),
      'documento'            => new sfValidatorPass(array('required' => false)),
      'cuil'                 => new sfValidatorPass(array('required' => false)),
      'fecha_nacimiento'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'ciudad_actual_id'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ciudad_actual'), 'column' => 'id')),
      'ciudad_nacimiento_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ciudad_nacimiento'), 'column' => 'id')),
      'nacionalidad_id'      => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('nacionalidad'), 'column' => 'id')),
      'sede_id'              => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('sede'), 'column' => 'id')),
      'sf_guard_user_id'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('usuario'), 'column' => 'id')),
      'created_at'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'created_by'           => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Creator'), 'column' => 'id')),
      'updated_by'           => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Updator'), 'column' => 'id')),
      'version'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('alumno_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Alumno';
  }

  public function getFields()
  {
    return array(
      'id'                   => 'Number',
      'apellido'             => 'Text',
      'nombre'               => 'Text',
      'domicilio'            => 'Text',
      'telefono'             => 'Text',
      'celular'              => 'Text',
      'email'                => 'Text',
      'tipo_doc_id'          => 'ForeignKey',
      'documento'            => 'Text',
      'cuil'                 => 'Text',
      'fecha_nacimiento'     => 'Date',
      'ciudad_actual_id'     => 'ForeignKey',
      'ciudad_nacimiento_id' => 'ForeignKey',
      'nacionalidad_id'      => 'ForeignKey',
      'sede_id'              => 'ForeignKey',
      'sf_guard_user_id'     => 'ForeignKey',
      'created_at'           => 'Date',
      'updated_at'           => 'Date',
      'created_by'           => 'ForeignKey',
      'updated_by'           => 'ForeignKey',
      'version'              => 'Number',
    );
  }
}
